
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessObject;
using DataAccessLayer;

namespace BusinessLogic
{
    /// <summary>
    /// Define PhieuNhapHangUtil class. This class user for BussinessLayer.

    /// </summary>
    public class PhieuNhapHangUtil
    {
        /// <summary>
        /// Define function Insert for PhieuNhapHang Object.
        /// </summary>
        /// <param name="t">object data need Insert.</param>
        /// <returns>
        ///    True: if insert successfull.
        ///    False: if insert error.
        ///</returns>
        public static bool Insert(PhieuNhapHang t)
        {

            return PhieuNhapHangDao.Insert(t);
        }
        /// <summary>
        /// Define function Update for PhieuNhapHang Object.
        /// </summary>
        /// <param name="t">project data need updated.</param>
        /// <returns>
        ///    True: if update successful.
        ///    False: if update Error.
        ///</returns>
        public static bool Update(PhieuNhapHang t)
        {

            return PhieuNhapHangDao.Update(t);
        }
        /// <summary>
        /// Get All PhieuNhapHang object from table PhieuNhapHang.
        /// </summary>
        /// <returns>List PhieuNhapHang object.</returns>
        public static List<PhieuNhapHangResult> GetAll()
        {
            return PhieuNhapHangDao.GetAll();
        }
        /// <summary>
        /// Search PhieuNhapHang object in table PhieuNhapHang.
        /// </summary>
        /// <param name="t">Condition for Search.</param>

        /// <returns>List PhieuNhapHangResult objects.</returns>

        public static List<PhieuNhapHangResult> SearchPhieuNhapHangSomeCondition(PhieuNhapHang t)
        {
            return PhieuNhapHangDao.SearchPhieuNhapHangSomeCondition(t);
        }
        /// <summary>
        /// Get a PhieuNhapHang data object by primary key. 
        /// </summary>
        /// <param name="maPhieuNhapHang" >This is primary key.</param>
        /// <returns>A PhieuNhapHang object.</returns>

        public static PhieuNhapHang Get(Int64 maPhieuNhapHang)
        {
            return PhieuNhapHangDao.Get(maPhieuNhapHang);
        }
        /// <summary>
        /// This function to Delete PhieuNhapHang object by primary key.
        /// </summary>
        /// <param name="maPhieuNhapHang" >This is primary key.</param>
        /// <returns>If succesful return True else  return False.</returns>

        public static bool Delete(Int64 maPhieuNhapHang)
        {
            if (maPhieuNhapHang <= 0)
                return false;
            return PhieuNhapHangDao.Delete(maPhieuNhapHang);
        }
        public static Int64 Insert(PhieuNhapHang obj, List<ChiTietPhieuNhapHang> lstChiTietPhieuNhap,NhaCungCap objNhaCC)
        {
            return PhieuNhapHangDao.Insert(obj, lstChiTietPhieuNhap,objNhaCC);
        }
        public static bool Update(PhieuNhapHang obj, List<ChiTietPhieuNhapHang> lstChiTietPhieuNhap, NhaCungCap objNhaCC)
        {
            return PhieuNhapHangDao.Update(obj, lstChiTietPhieuNhap,objNhaCC);
        }
        public static Curency GetCurencyForPhieuNhapHang(Int64 maPhieu)
        {
            return PhieuNhapHangDao.GetCurencyForPhieuNhapHang(maPhieu);
        }
        public static Boolean CommitPhieuNhapHang(Int64 maPhieuNhapHang, string updatedBy, DateTime updateDate)
        {
            return PhieuNhapHangDao.CommitPhieuNhapHang(maPhieuNhapHang, updatedBy, updateDate);
        }
    }
}